if Not  exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[History_TmpDrugHavaleh]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
Begin
CREATE TABLE [dbo].[History_TmpDrugHavaleh](
	[Id_Havaleh] [bigint] NOT NULL,
	[Sender] [varchar](5) NOT NULL,
	[Reciver] [varchar](8) NOT NULL,
	[Radif] [smallint] NULL,
	[K_Code] [varchar](15) NOT NULL,
	[K_Qty1] [float] NOT NULL,
	[Price_Kharid] [money] NULL,
	[Price_Forosh] [money] NULL,
	[Main_Price] [money] NULL,
	[Status] [smallint] NULL,
	[BimarPercent] [real] NULL
) ON [PRIMARY]


ALTER TABLE [dbo].[History_TmpDrugHavaleh]  WITH CHECK ADD  CONSTRAINT [FK_History_TmpDrugHavaleh_History_TmpDrugH] FOREIGN KEY([Id_Havaleh])
REFERENCES [dbo].[History_TmpDrugH] ([Id_Havaleh])
ON DELETE CASCADE


ALTER TABLE [dbo].[History_TmpDrugHavaleh] CHECK CONSTRAINT [FK_History_TmpDrugHavaleh_History_TmpDrugH]
End

